# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Dataproc.V1.Model.StageData do
  @moduledoc """
  Data corresponding to a stage.

  ## Attributes

  *   `accumulatorUpdates` (*type:* `list(GoogleApi.Dataproc.V1.Model.AccumulableInfo.t)`, *default:* `nil`) - 
  *   `numActiveTasks` (*type:* `integer()`, *default:* `nil`) - 
  *   `name` (*type:* `String.t`, *default:* `nil`) - 
  *   `rddIds` (*type:* `list(String.t)`, *default:* `nil`) - 
  *   `numCompletedIndices` (*type:* `integer()`, *default:* `nil`) - 
  *   `numKilledTasks` (*type:* `integer()`, *default:* `nil`) - 
  *   `completionTime` (*type:* `DateTime.t`, *default:* `nil`) - 
  *   `stageId` (*type:* `String.t`, *default:* `nil`) - 
  *   `firstTaskLaunchedTime` (*type:* `DateTime.t`, *default:* `nil`) - 
  *   `description` (*type:* `String.t`, *default:* `nil`) - 
  *   `numTasks` (*type:* `integer()`, *default:* `nil`) - 
  *   `failureReason` (*type:* `String.t`, *default:* `nil`) - 
  *   `parentStageIds` (*type:* `list(String.t)`, *default:* `nil`) - 
  *   `numFailedTasks` (*type:* `integer()`, *default:* `nil`) - 
  *   `peakExecutorMetrics` (*type:* `GoogleApi.Dataproc.V1.Model.ExecutorMetrics.t`, *default:* `nil`) - 
  *   `schedulingPool` (*type:* `String.t`, *default:* `nil`) - 
  *   `resourceProfileId` (*type:* `integer()`, *default:* `nil`) - 
  *   `details` (*type:* `String.t`, *default:* `nil`) - 
  *   `locality` (*type:* `map()`, *default:* `nil`) - 
  *   `tasks` (*type:* `%{optional(String.t) => GoogleApi.Dataproc.V1.Model.TaskData.t}`, *default:* `nil`) - 
  *   `stageMetrics` (*type:* `GoogleApi.Dataproc.V1.Model.StageMetrics.t`, *default:* `nil`) - 
  *   `isShufflePushEnabled` (*type:* `boolean()`, *default:* `nil`) - 
  *   `killedTasksSummary` (*type:* `map()`, *default:* `nil`) - 
  *   `shuffleMergersCount` (*type:* `integer()`, *default:* `nil`) - 
  *   `executorSummary` (*type:* `%{optional(String.t) => GoogleApi.Dataproc.V1.Model.ExecutorStageSummary.t}`, *default:* `nil`) - 
  *   `numCompleteTasks` (*type:* `integer()`, *default:* `nil`) - 
  *   `executorMetricsDistributions` (*type:* `GoogleApi.Dataproc.V1.Model.ExecutorMetricsDistributions.t`, *default:* `nil`) - 
  *   `jobIds` (*type:* `list(String.t)`, *default:* `nil`) - 
  *   `taskQuantileMetrics` (*type:* `GoogleApi.Dataproc.V1.Model.TaskQuantileMetrics.t`, *default:* `nil`) - Summary metrics fields. These are included in response only if present in summary_metrics_mask field in request
  *   `stageAttemptId` (*type:* `integer()`, *default:* `nil`) - 
  *   `status` (*type:* `String.t`, *default:* `nil`) - 
  *   `submissionTime` (*type:* `DateTime.t`, *default:* `nil`) - 
  *   `speculationSummary` (*type:* `GoogleApi.Dataproc.V1.Model.SpeculationStageSummary.t`, *default:* `nil`) - 
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :accumulatorUpdates => list(GoogleApi.Dataproc.V1.Model.AccumulableInfo.t()) | nil,
          :numActiveTasks => integer() | nil,
          :name => String.t() | nil,
          :rddIds => list(String.t()) | nil,
          :numCompletedIndices => integer() | nil,
          :numKilledTasks => integer() | nil,
          :completionTime => DateTime.t() | nil,
          :stageId => String.t() | nil,
          :firstTaskLaunchedTime => DateTime.t() | nil,
          :description => String.t() | nil,
          :numTasks => integer() | nil,
          :failureReason => String.t() | nil,
          :parentStageIds => list(String.t()) | nil,
          :numFailedTasks => integer() | nil,
          :peakExecutorMetrics => GoogleApi.Dataproc.V1.Model.ExecutorMetrics.t() | nil,
          :schedulingPool => String.t() | nil,
          :resourceProfileId => integer() | nil,
          :details => String.t() | nil,
          :locality => map() | nil,
          :tasks => %{optional(String.t()) => GoogleApi.Dataproc.V1.Model.TaskData.t()} | nil,
          :stageMetrics => GoogleApi.Dataproc.V1.Model.StageMetrics.t() | nil,
          :isShufflePushEnabled => boolean() | nil,
          :killedTasksSummary => map() | nil,
          :shuffleMergersCount => integer() | nil,
          :executorSummary =>
            %{optional(String.t()) => GoogleApi.Dataproc.V1.Model.ExecutorStageSummary.t()} | nil,
          :numCompleteTasks => integer() | nil,
          :executorMetricsDistributions =>
            GoogleApi.Dataproc.V1.Model.ExecutorMetricsDistributions.t() | nil,
          :jobIds => list(String.t()) | nil,
          :taskQuantileMetrics => GoogleApi.Dataproc.V1.Model.TaskQuantileMetrics.t() | nil,
          :stageAttemptId => integer() | nil,
          :status => String.t() | nil,
          :submissionTime => DateTime.t() | nil,
          :speculationSummary => GoogleApi.Dataproc.V1.Model.SpeculationStageSummary.t() | nil
        }

  field(:accumulatorUpdates, as: GoogleApi.Dataproc.V1.Model.AccumulableInfo, type: :list)
  field(:numActiveTasks)
  field(:name)
  field(:rddIds, type: :list)
  field(:numCompletedIndices)
  field(:numKilledTasks)
  field(:completionTime, as: DateTime)
  field(:stageId)
  field(:firstTaskLaunchedTime, as: DateTime)
  field(:description)
  field(:numTasks)
  field(:failureReason)
  field(:parentStageIds, type: :list)
  field(:numFailedTasks)
  field(:peakExecutorMetrics, as: GoogleApi.Dataproc.V1.Model.ExecutorMetrics)
  field(:schedulingPool)
  field(:resourceProfileId)
  field(:details)
  field(:locality, type: :map)
  field(:tasks, as: GoogleApi.Dataproc.V1.Model.TaskData, type: :map)
  field(:stageMetrics, as: GoogleApi.Dataproc.V1.Model.StageMetrics)
  field(:isShufflePushEnabled)
  field(:killedTasksSummary, type: :map)
  field(:shuffleMergersCount)
  field(:executorSummary, as: GoogleApi.Dataproc.V1.Model.ExecutorStageSummary, type: :map)
  field(:numCompleteTasks)

  field(:executorMetricsDistributions,
    as: GoogleApi.Dataproc.V1.Model.ExecutorMetricsDistributions
  )

  field(:jobIds, type: :list)
  field(:taskQuantileMetrics, as: GoogleApi.Dataproc.V1.Model.TaskQuantileMetrics)
  field(:stageAttemptId)
  field(:status)
  field(:submissionTime, as: DateTime)
  field(:speculationSummary, as: GoogleApi.Dataproc.V1.Model.SpeculationStageSummary)
end

defimpl Poison.Decoder, for: GoogleApi.Dataproc.V1.Model.StageData do
  def decode(value, options) do
    GoogleApi.Dataproc.V1.Model.StageData.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Dataproc.V1.Model.StageData do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
